import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'

export const constantRouterMap = [
  {
    path: '',
    component: Layout,
    redirect: '/welcome/welcome'
  },
  { path: '/login', component: () => import('@/views/login'), name: '登录平台', hidden: true },
  { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true },
  // 锁屏
  {
    path: '/lock',
    hidden: true,
    name: '锁屏页',
    component: () => import('@/views/common/lock')
  },
  {
    path: '/welcome',
    component: Layout,
    meta: { title: '首页', icon: 'a_00首页' },
    children: [
      {
        path: 'welcome',
        name: '首页',
        component: () => import('@/views/welcome'),
        meta: { title: '首页', icon: 'a_00首页', handId: '-1' }
      }
    ]
  }
]
export default new Router({
  // mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
